package com.example.boot.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.example.boot.user.entity.UserInfoEntity;
import com.example.boot.user.service.UserInfoService;
import com.example.boot.util.ResultData;
import com.example.boot.util.ResultUtil;

@RestController
public class UserInfoController {
	@Autowired
	private UserInfoService userInfoService;

	@RequestMapping(value = "add/userInfo", method = RequestMethod.GET)
	public ResultData<Boolean> addUserInfo(UserInfoEntity user) throws Exception {

		return ResultUtil.success(userInfoService.addUserInfo(user));

	}

	@RequestMapping(value = "user/login", method = RequestMethod.GET)
	public ResultData<UserInfoEntity> userLogin(String name, String pwd) throws Exception {

		return ResultUtil.success(userInfoService.userLogin(name, pwd));

	}

}
